let rec power x n =
 
  if n < 0 then 
    invalid_arg "puissance negative"
  else

  match n with 
     0 -> 1
    |_ -> x * power x (n-1);;

power 1 2;;

let rec application list x =
  
  match list with 
    [] -> 0
   |(a,n)::l -> (a * power x n) + application l x;;

application [(2,2);(2,3);(4,4)] 2;;

let rec add list1 list2 =

  match (list1,list2) with
     ([],[]) -> 0
    |((a1,b1)::list1, (a2,b2)::list2) -> 
      if b1 = b2 then
	(a1+a2,b1)::l
      else 
	(a1,b1)::(a2,b2)::l;
    |

